﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using AssetManageSystem.Model.AssetManage;
using AssetManageSystem.Model.OrgManage;


namespace AssetManageSystem.ViewModel.AssetManage.AssetConsumingVMs
{
    public partial class AssetConsumingSearcher : BaseSearcher
    {
        public List<ComboSelectListItem> AllAsUsers { get; set; }
        [Display(Name ="领用人")]
        public Guid? AsUserId { get; set; }
        public List<ComboSelectListItem> AllUnits { get; set; }
        [Display(Name = "领用部门")]
        public Guid? UnitId { get; set; }
        public List<ComboSelectListItem> AllAssetIds { get; set; }
        public List<Guid> SelectedAssetIdIDs { get; set; }

        public Guid? Id {get;set;}

        protected override void InitVM()
        {
            AllAsUsers = DC.Set<User>().GetSelectListItems(Wtm, y => y.UserName);
            AllUnits = DC.Set<Department>().GetSelectListItems(Wtm, y => y.DepName);
            AllAssetIds = DC.Set<AssetInfo>().GetSelectListItems(Wtm, y => y.AsName);
        }

    }
}
